//
// Created by xili on 2024/8/24 14:07.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int numOfPairs(vector <string> &nums, string target) {
        int n = nums.size();
        int m = target.size();
        int ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (j == i || nums[i].size() + nums[j].size() != m) {
                    continue;
                }
                ans += nums[i] + nums[j] == target ? 1 : 0;
            }
        }
        return ans;
    }
};